//更多的显示与隐藏



  //下拉显示
  window.downs=function(){
    var down=$api.byId('down');
    var top=$api.byId('top');
    var more_xiu=$api.byId('more_xiu');
    $api.css(more_xiu,'display:block');
    $api.css(down,'display:none');
  }
 //收起隐藏
  window.tops=function(){
    var down=$api.byId('down');
    var top=$api.byId('top');
    var more_xiu=$api.byId('more_xiu');
    $api.css(more_xiu,'display:none');
    $api.css(down,'display:block');
  }


  function ajaxupdate(body,el,val)
  {
      api.ajax({
          url: 'http://www.mk517.com/webApi/xiu_update.php',
          method: 'post',
          dataType: 'json',
          "headers": {
              "Content-Type": "application/json"
          },
          data: {
              body: body
          }
      },function(ret, err){
          if (ret) {
              if(ret.info=='true')
              {
                 alert('修改成功');
                 $api.text(el,val);
              }
          } else {
              alert( JSON.stringify( err ) );
          }
      });

  }



  //修改城市
  window.updateinfo=function(){
     var el = $api.byId('address');
    var citySelector = api.require('citySelector');
    citySelector.open({
        y: api.frameHeight / 1.6,
        fixedOn: api.frameName
    }, function(ret) {
        if (ret) {
          var body={
            token:$api.getStorage('token'),
            fidle:'address',
            value:ret.province+'-'+ret.city+'-'+ret.county,
          }
          var val=body.value;
          ajaxupdate(body,el,val);
        }
    });
  }
  //修改月均收入
  window.update_income=function(){
    var UIMultiSelector = api.require('UIMultiSelector');
    UIMultiSelector.open({
       rect: {
           h: 244
       },
       text: {
           title: '月均收入',
           leftBtn: '取消',
           rightBtn: '确定',
           selectAll: 'ALL'
       },
       max: 0,
       singleSelection: true,
       styles: {
           mask: 'rgba(0,0,0,0)',
           title: {
               bg: '#E5E5E5',
               color: '#333',
               size: 14,
               h: 44
           },
           leftButton: {
               bg: '#CCCCCC',
               w: 80,
               h: 35,
               marginT: 5,
               marginL: 8,
               color: '#666666',
               size: 14
           },
           rightButton: {
               bg: '#87CEFF',
               w: 80,
               h: 35,
               marginT: 5,
               marginR: 8,
               color: '#666666',
               size: 14
           },
           item: {
               h: 50,
               bg: '#FCFCFC',
               bgActive: '#87CEFF',
               bgHighlight: '#E5E5E5',
               color: '#666666',
               active: '#666666',
               highlight: '#666666',
               size: 14,
               lineColor: '#C4C4C4',
               textAlign: 'center'
           },
       },
       animation: true,
       items: [{
           text: '2000元以下',
           status: 'normal'
       }, {
           text: '2000-4000元',
           status: 'normal'
       }, {
           text: '4000-6000元',
           status: 'normal'
       }, {
           text: '6000-10000元',
           status: 'normal'
       }, {
           text: '10000-12000元',
           status: 'normal'
       }, {
           text: '12000-15000元',
           status: 'normal'
       }, {
           text: '15000-50000元',
           status: 'normal'
       }, {
           text: '50000元以上',
           status: 'normal'
       }]
   }, function(ret, err) {
       if (ret) {
           alert(JSON.stringify(ret));
       } else {
          //  alert(JSON.stringify(err));
       }
   });
  }
  //修改身高
  window.update_height=function(){

  }
  //修改体重
  window.update_height=function(){

  }
  //学历
  window.update_xueli=function(){
    var UIMultiSelector = api.require('UIMultiSelector');
    UIMultiSelector.open({
       rect: {
           h: 244
       },
       text: {
           title: '学历',
           leftBtn: '取消',
           rightBtn: '确定',
           selectAll: 'ALL'
       },
       max: 0,
       singleSelection: true,
       styles: {
           mask: 'rgba(0,0,0,0)',
           title: {
               bg: '#E5E5E5',
               color: '#333',
               size: 14,
               h: 44
           },
           leftButton: {
               bg: '#CCCCCC',
               w: 80,
               h: 35,
               marginT: 5,
               marginL: 8,
               color: '#666666',
               size: 14
           },
           rightButton: {
               bg: '#87CEFF',
               w: 80,
               h: 35,
               marginT: 5,
               marginR: 8,
               color: '#666666',
               size: 14
           },
           item: {
               h: 50,
               bg: '#FCFCFC',
               bgActive: '#87CEFF',
               bgHighlight: '#E5E5E5',
               color: '#666666',
               active: '#666666',
               highlight: '#666666',
               size: 14,
               lineColor: '#C4C4C4',
               textAlign: 'center'
           },
       },
       animation: true,
       items: [{
           text: '大专以下',
           status: 'normal'
       }, {
           text: '大专',
           status: 'normal'
       }, {
           text: '本科',
           status: 'normal'
       }, {
           text: '硕士',
           status: 'normal'
       }, {
           text: '博士',
           status: 'normal'
       }]
   }, function(ret, err) {
       if (ret) {
           alert(JSON.stringify(ret));
       } else {
          //  alert(JSON.stringify(err));
       }
   });
  }
  //婚姻状态
  window.update_state=function(){
    var UIMultiSelector = api.require('UIMultiSelector');
    UIMultiSelector.open({
       rect: {
           h: 244
       },
       text: {
           title: '月均收入',
           leftBtn: '取消',
           rightBtn: '确定',
           selectAll: 'ALL'
       },
       max: 0,
       singleSelection: true,
       styles: {
           mask: 'rgba(0,0,0,0)',
           title: {
               bg: '#E5E5E5',
               color: '#333',
               size: 14,
               h: 44
           },
           leftButton: {
               bg: '#CCCCCC',
               w: 80,
               h: 35,
               marginT: 5,
               marginL: 8,
               color: '#666666',
               size: 14
           },
           rightButton: {
               bg: '#87CEFF',
               w: 80,
               h: 35,
               marginT: 5,
               marginR: 8,
               color: '#666666',
               size: 14
           },
           item: {
               h: 50,
               bg: '#FCFCFC',
               bgActive: '#87CEFF',
               bgHighlight: '#E5E5E5',
               color: '#666666',
               active: '#666666',
               highlight: '#666666',
               size: 14,
               lineColor: '#C4C4C4',
               textAlign: 'center'
           },
       },
       animation: true,
       items: [{
           text: '未婚',
           status: 'normal'
       }, {
           text: '丧偶',
           status: 'normal'
       },{
           text: '离异',
           status: 'normal'
       }]
   }, function(ret, err) {
       if (ret) {
           alert(JSON.stringify(ret));
       } else {
          //  alert(JSON.stringify(err));
       }
   });
  }
  //择偶要求
  window.update_sexlike=function(){
    var UIMultiSelector = api.require('UIMultiSelector');
    UIMultiSelector.open({
       rect: {
           h: 244
       },
       text: {
           title: '月均收入',
           leftBtn: '取消',
           rightBtn: '确定',
           selectAll: 'ALL'
       },
       max: 0,
       singleSelection: true,
       styles: {
           mask: 'rgba(0,0,0,0)',
           title: {
               bg: '#E5E5E5',
               color: '#333',
               size: 14,
               h: 44
           },
           leftButton: {
               bg: '#CCCCCC',
               w: 80,
               h: 35,
               marginT: 5,
               marginL: 8,
               color: '#666666',
               size: 14
           },
           rightButton: {
               bg: '#87CEFF',
               w: 80,
               h: 35,
               marginT: 5,
               marginR: 8,
               color: '#666666',
               size: 14
           },
           item: {
               h: 50,
               bg: '#FCFCFC',
               bgActive: '#87CEFF',
               bgHighlight: '#E5E5E5',
               color: '#666666',
               active: '#666666',
               highlight: '#666666',
               size: 14,
               lineColor: '#C4C4C4',
               textAlign: 'center'
           },
       },
       animation: true,
       items: [{
           text: '男',
           status: 'normal'
       }, {
           text: '女',
           status: 'normal'
       }]
   }, function(ret, err) {
       if (ret) {
           alert(JSON.stringify(ret));
       } else {
          //  alert(JSON.stringify(err));
       }
   });
  }
  //生日
  window.update_barth=function()
  {
    api.openPicker({
        type : 'date',
        date : '1980-01-01 12:00',
        title : '请选择日期'
      }, function(ret, err) {
        $api.html($api.byId('birthday'), ret.year + '-' + ret.month + '-' + ret.day);
      });
  }
  //职业行业
  window.update_industry=function(){
    var UIMultiSelector = api.require('UIMultiSelector');
    UIMultiSelector.open({
       rect: {
           h: 244
       },
       text: {
           title: '职业行业',
           leftBtn: '取消',
           rightBtn: '确定',
           selectAll: 'ALL'
       },
       max: 0,
       singleSelection: true,
       styles: {
           mask: 'rgba(0,0,0,0)',
           title: {
               bg: '#E5E5E5',
               color: '#333',
               size: 14,
               h: 44
           },
           leftButton: {
               bg: '#CCCCCC',
               w: 80,
               h: 35,
               marginT: 5,
               marginL: 8,
               color: '#666666',
               size: 14
           },
           rightButton: {
               bg: '#87CEFF',
               w: 80,
               h: 35,
               marginT: 5,
               marginR: 8,
               color: '#666666',
               size: 14
           },
           item: {
               h: 50,
               bg: '#FCFCFC',
               bgActive: '#87CEFF',
               bgHighlight: '#E5E5E5',
               color: '#666666',
               active: '#666666',
               highlight: '#666666',
               size: 14,
               lineColor: '#C4C4C4',
               textAlign: 'center'
           },
       },
       animation: true,
       items: [{
           text: '计算机/互联网/通讯',
           status: 'normal'
       },
       {
           text: '公务员/事业/单位',
           status: 'normal'
       },
       {
           text: '教师',
           status: 'normal'
       },
       {
           text: '医生',
           status: 'normal'
       },
       {
           text: '护士',
           status: 'normal'
       },
       {
           text: '空乘人员',
           status: 'normal'
       },
       {
           text: '生产/工艺/制造',
           status: 'normal'
       },
       {
           text: '商业/服务业/个体经营',
           status: 'normal'
       },
       {
           text: '金融/银行/投资/保险',
           status: 'normal'
       },
       {
           text: '文化/广告/传媒',
           status: 'normal'
       },
       {
           text: '娱乐/艺术/表演',
           status: 'normal'
       },
       {
           text: '律师/法务',
           status: 'normal'
       },
       {
           text: '教育/培训/管理咨询',
           status: 'normal'
       },
       {
           text: '消费零售/贸易/交通',
           status: 'normal'
       },
       {
           text: '酒店旅游',
           status: 'normal'
       },
       {
           text: '现代农业',
           status: 'normal'
       },
       {
           text: '在校大学生',
           status: 'normal'
       }
     ]
   }, function(ret, err) {
       if (ret) {
           alert(JSON.stringify(ret));
       } else {
          //  alert(JSON.stringify(err));
       }
   });
  }
